import re

# Replace 'your_file.txt' with the path to your text file
file_path = 'test.txt'

# Read the content of the file
with open(file_path, 'r') as file:
    content = file.read()

# Use a regular expression to find the entire block of 'resource = {...}'
# This pattern matches 'resource = {' followed by any characters (including newlines) until '}'
pattern = re.compile(r'modifier = \{(.*?)\}', re.DOTALL)

# Find all matches and replace them with an empty string
# The re.DOTALL flag allows the dot (.) to match newlines as well
content_modified = pattern.sub('', content)

# Write the modified content back to the file
with open(file_path, 'w') as file:
    file.write(content_modified)

print("All 'resource = {...}' blocks have been removed.")
